package com.hboxs.asl.util;

import com.hboxs.asl.entity.Merchant;
import com.hboxs.asl.service.MerchantService;
import org.springframework.context.ApplicationContext;

/**
 * Created by difeng JIMO on 2016/05/15.
 */
public class MerchantUtils {

    // 获取当前登录的商家
    public static Merchant getCurrentMerchant(){
        ApplicationContext applicationContext = SpringUtils.getApplicationContext();
        if (applicationContext != null) {
            MerchantService merchantService = SpringUtils.getBean("merchantServiceImpl", MerchantService.class);
            return merchantService.getCurrent();
        }
        return null;
    }


}
